-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rc/v3.0.1.5 #972
base: main
Are you sure you want to change the base?
Rc/v3.0.1.5 #972
Conversation
All xMex fees to users
Coverage SummaryTotals
FilesExpand
|
Contract comparison - from 684bff8 to b280ca1
|
…okens Disable add liquidity for locked tokens
change undistributed rewards code
additional tests for add liq disabled
change disable add liq code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rc/v3.0.1 is not used any longer, it was merged to main. Anyway, this should not be merged until we have a clear launch date.
The base branch was changed.
Merge rc/v3.0.1.5 with main
Merge rc 3015 with main
} | ||
|
||
#[endpoint(transferUnlockedToken)] | ||
fn transfer_unlocked_token(&self, dest: ManagedAddress, amount: BigUint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The caller should not be given as a parameter. We should have an only_owner endpoint which sets the address in the energy factory storage. And we use only that. The farm should not have a saying in where the tokens are sent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disagree. Not only farms will potentially use this, and they don't all have the same owner. We've discussed this previously.
.direct_esdt(&dest, &base_asset_token_id, 0, &amount); | ||
} | ||
|
||
#[storage_mapper("ulkTokenTransfWhitelist")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This storage is kinda like the same with the sc_whitelist_addresses storage, only that that storage has some extra contracts whitelisted in it. Not sure if we need the extra storage tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't want to reuse whitelists. It makes the code very messy. Nobody knows what's there anymore, why it's there, etc.
); | ||
penalty_tokens.push(penalty); | ||
} | ||
self.handle_single_unbond_entry(&entry, &mut penalty_tokens); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping in mind that the previous version of token-unstake will go live in a few days, I don't think a new upgrade will be done any time soon. So I would avoid having any code refactor, as that will increase the difficulty in the release process, by bringing a new codehash. And anyways, it will not be deployed on mainnet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't care about code hashes, and I refuse to keep bad code around just for that silly reason. There's literally nothing to test, it's the same code.
self.add_liq_enabled().set(ADD_LIQ_DISABLED); | ||
} | ||
|
||
fn require_add_liq_enabled(&self) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if this would act in a reverse way? Not add liquidity enabled, but add liquidity paused. So you have to write in storage whenever you want to pause the adding of liquidity. In other words, we would modify only this module, not the implementation in other contracts. We could keep require_add_liq_enabled as is, but check the storage has something instead of being empty.
This would be helpful when upgrading the contracts, so that the owner doesn't need to call the extra allow function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...it was you who told me to do it this way, in this very same PR, and now you want it the other way again?
@@ -52,9 +52,23 @@ pub trait EnergyFactoryMock { | |||
self.user_energy(&user).set(&energy); | |||
} | |||
|
|||
#[endpoint(transferUnlockedToken)] | |||
fn transfer_unlocked_token(&self, dest: ManagedAddress, amount: BigUint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can anyone call this function ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This contract is just a mock, so it doesn't matter.
self.emit_unlocked_tokens_event(&caller, new_unlocked_tokens); | ||
|
||
output_payments.into() | ||
} | ||
|
||
fn handle_single_unbond_entry( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unstake refactor can enter. This is safe code.
No description provided.